<?php
$d=dir(".");
$a=array();
$i=0;
while(false!=($entry=$d->read()))
	{
	if(substr($entry,strlen($entry)-4,4)==".php") 
		{
		$a[$i++] = $entry;
		}
	}
	
foreach ($a as $aentry){echo($aentry."<br>");}
echo(count($a)."<br>");




?>